const express = require("express");

const app = express();

// {
//   path: '/xxxx/:id'
// }

// http://localhost:3000/posts/a
// http://localhost:3000/posts      不能
// http://localhost:3000/posts/b
app.get("/posts/:id", (req, res, next) => {
  res.send(`posts ${req.params.id}`);
});

app.listen(3000);
